import 'package:winkai/generated/json/base/json_convert_content.dart';
import 'package:winkai/entity/send_msg_rsp.dart';

SendMsgRsp $SendMsgRspFromJson(Map<String, dynamic> json) {
  final SendMsgRsp sendMsgRsp = SendMsgRsp();
  final int? convId = jsonConvert.convert<int>(json['conv_id']);
  if (convId != null) {
    sendMsgRsp.convId = convId;
  }
  final String? msgId = jsonConvert.convert<String>(json['msg_id']);
  if (msgId != null) {
    sendMsgRsp.msgId = msgId;
  }
  final List<String>? nextMsgs = (json['next_msgs'] as List<dynamic>?)?.map(
          (e) => jsonConvert.convert<String>(e) as String).toList();
  if (nextMsgs != null) {
    sendMsgRsp.nextMsgs = nextMsgs;
  }
  return sendMsgRsp;
}

Map<String, dynamic> $SendMsgRspToJson(SendMsgRsp entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['conv_id'] = entity.convId;
  data['msg_id'] = entity.msgId;
  data['next_msgs'] = entity.nextMsgs;
  return data;
}

extension SendMsgRspExtension on SendMsgRsp {
  SendMsgRsp copyWith({
    int? convId,
    String? msgId,
    List<String>? nextMsgs,
  }) {
    return SendMsgRsp()
      ..convId = convId ?? this.convId
      ..msgId = msgId ?? this.msgId
      ..nextMsgs = nextMsgs ?? this.nextMsgs;
  }
}